"""
class tuple([iterable])
可以用多种方式构建元组：
使用一对圆括号来表示空元组: ()
使用一个后缀的逗号来表示单元组: a, 或 (a,)
使用以逗号分隔的多个项: a, b, c or (a, b, c)
使用内置的 tuple(): tuple() 或 tuple(iterable)
"""

t = 12345, 54321, 'hello!'
t = (12345, 54321, 'hello!')

# 生成元祖
combs = [(x, x**2) for x in range(6)]


# 集合 集合元素无序，且不重复
basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
a = set('abracadabra')
# a   {'a', 'r', 'b', 'c', 'd'}  # unique letters in a
b = set('alacazam')
# b   {'a', 'l',  'c','z', 'm'}  # unique letters in b
a - b                              # letters in a but not in b
# {'r', 'd', 'b'}
a | b                              # letters in a or b or both
# {'a', 'c', 'r', 'd', 'b', 'm', 'z', 'l'}
a & b                              # letters in both a and b
# {'a', 'c'}
a ^ b                              # letters in a or b but not both
# {'r', 'd', 'b', 'm', 'z', 'l'}
a = {x for x in 'abracadabra' if x not in 'abc'}
# a {'r', 'd'}